const router = require('koa-router')()
const goodsSkuType = require('../api/myGoodsSkuType')
router.prefix('/goodsSkuType')
// #region
/**
 * @swagger
 * /goodsSkuType/modifySkuType 修改或增加sku小类规格:
 *   post:
 *     description: 修改或增加sku小类规格
 *     tags: [商品Sku模块]
 *     produces:
 *       - application/json
 *     parameters:
 *       - name: id
 *         description: 小类id，传了为修改，没有传id为增加
 *         in: formData
 *         required: false
 *         type: number
 *       - name: goodsId
 *         description: 商品id
 *         in: formData
 *         required: true
 *         type: number
 *       - name: skuId
 *         description: 大类sku Id
 *         in: formData
 *         required: true
 *         type: number
 *       - name: name
 *         description: 小类规格名称
 *         in: formData
 *         required: false
 *         type: string
 *       - name: imgId
 *         description: 规格预览图片 id
 *         in: formData
 *         required: false
 *         type: number
 *     responses:
 *       0:
 *         description: 成功
 *         schema:
 *           type: object
 *           $ref: '#/definitions/success'
 *       -1:
 *         description: 失败
 *         schema:
 *           type: object
 *           $ref: '#/definitions/fail'
 */
// #endregion
router.post('/modifySkuType', goodsSkuType.modifySkuType)
// #region
/**
 * @swagger
 * /goodsSkuType/deleteSkuType 删除sku规格小类（参数放到请求头query）:
 *   delete:
 *     description: 删除sku规格小类（参数放到请求头query）
 *     tags: [商品Sku模块]
 *     parameters:
 *       - name: ids
 *         description: Sku 小类规格 id（可传多个）
 *         in: formData
 *         required: false
 *         type: number
 *     responses:
 *       0:
 *         description: 成功
 *         schema:
 *           type: object
 *           $ref: '#/definitions/success'
 *       -1:
 *         description: 失败
 *         schema:
 *           type: object
 *           $ref: '#/definitions/fail'
 */
// #endregion
router.delete('/deleteSkuType', goodsSkuType.deleteSkuType)
module.exports = router